package ex99;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	
	public static int sumOdd(int x, int y) {
		int min = Math.min(x, y);
		int max = Math.max(x, y);
		int sum = 0;

		for (int i = min+1; i < max; i++) {
			if (!((i % 2) == 0)) {
				sum += i;
			}
		}
		return sum;
	}

	public static void main(String[] args) throws IOException {
		
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		
		int x = Integer.parseInt(in.readLine());
		int n[][] = new int[2][x];
		int nSum[] = new int[x];
		String input, inputParts[];
		
		for (int i = 0; i < x; i++) {
			
			input = in.readLine();
			inputParts = input.split(" ", 2);
			
			n[0][i] = Integer.parseInt(inputParts[0]);
			n[1][i] = Integer.parseInt(inputParts[1]);
			
			nSum[i] = sumOdd(n[0][i], n[1][i]);
			
		}
		
		for (int i = 0; i < x; i++) {
			System.out.println(nSum[i]);
		}
		
	}

}
